#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    //连接插槽
    connect(ui->actionConnect, &QAction::triggered, this, &MainWindow::StartConnect);
    QStandardItemModel *model = new QStandardItemModel(0,1);
    model->setHeaderData(0, Qt::Horizontal, tr("组件名"));
    QStandardItem *item_back = new QStandardItem(c_back.getName());
    item_back->setIcon(c_back.getS_img()->icon);
    qDebug() << c_back.getS_img()->imgName;
    model->setItem(0, 0, item_back);
    ui->tree_components->setModel(model);
    //设置不可编辑
    ui->tree_components->setEditTriggers(QAbstractItemView::NoEditTriggers);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::StartConnect()
{
    this->form_conn.show();
}
